package com.dai.design.openclose;

/**
 * @author daijiyong
 */
public class DiscountFoodCommodity extends FoodCommodity {
    private Double discount;

    public DiscountFoodCommodity(Integer id, String name, Double price, Double disount) {
        super(id, name, price);
        this.discount = disount;
    }

    public Double getDiscountPrice() {
        return super.getPrice() * discount;
    }

    public Double getDisount() {
        return discount;
    }

    @Override
    public String toString() {
        return "DiscountFoodCommodity{" +
                "id=" + getId() +
                ", name='" + getName() + '\'' +
                ", price=" + getDiscountPrice() +
                ", discount=" + getDisount() +
                '}';
    }
}
